Method and apparatus for use in measurement of the position of a line or edge of an object

ABSTRACT

In a digitized picture, the orientation of the line is made nearly, but not exactly, parallel to a coordinate axis. Statistical analysis of the grid points or of the lattice points forming the line, preferably the former, gives the position and orientation of the line with high accuracy. Repeated measurements after small displacements of the line allows further improvement of the accuracy. Rectangular objects can be measured by taking differences between positions of opposite edges. The method can be extended to deal with curved lines, areas or the detection and measurement of edge or line features such as angles or properties of arcs. Measurement apparatus for practicing the method is also disclosed.

This invention relates to a method and apparatus for use in measurement.The invention has particular, though not exclusive, application in themeasurement of flat objects or flat surfaces of bulky objects whenviewed by means of a digitizing television-type system. It is possibleto embody the invention in such a way that it may be used, in oneapplication, to monitor the size and shape of objects passing down aproduction line viewed by a television camera, from above.

There is a growing requirement for automated image analysis and in manyapplications this involves checking the size and shape of an objectconstituting an image. Checks of this sort are suitable forcomputer-control and, to present the image in a form suitable foranalysis by computer, the image must be digitized. The digitization maybe effected by taking the image acquired by a television camera orsimilar device and dividing it into picture elements (hereafter calledpixels). The pixels are arranged ideally in some regular pattern, ofwhich rectangular or hexagonal arrays are the most common, though othersare possible. In an embodiment to be described, a rectangular array ofpixels is employed, but the arrangement can readily be modified to applyto other geometries to define a measuring grid or lattice.

The resolution available in a digitized image depends to some extent onthe density of the pixel array. The most common systems use squarearrays of 256×256 or 512×512 pixels, but some have rectangular windowsor square arrays of up to 4096×4096 pixels; however, with normallypracticable lenses and cameras it is doubtful whether the true opticalresolution is better than can be achieved with a 512×512 pixel raster.Since, in the ideal case of perfect contrast between an object andbackground on the field of view, any particular pixel would be either"on" or "off", i.e. register as being either inside or outside theobject, it may be considered that the resolution of a digitized pictureis directly proportional to the inverse of the pixel density and that,for example, the length of an object detected by a 512×512 pixel arraycould be determined to only about 1 part in 500. This conclusion resultsfrom the practice of determining lengths by a point-to-point calculationwith the positions of the two points in question each carrying, in thisinstance, an error of up to unit inter-pixel distance.

It will be seen from the particular embodiments of the present inventionto be described that it is possible to determine the position of a lineor edge in a digitized picture to a much greater degree of accuracy thanplus or minus one unit of distance (the inter-pixel distance) by the useof at least one of three procedures:

(a) by employing many points to make a statistical analysis of theposition of the line,

(b) in the case of a straight line (or edge), by positioning the line sothat it makes a very small angle with one of the coordinate axes and

(c) by repeating the measurement an appropriate number of times (e.g. 10times) with small relative displacements of the camera, the object orthe measuring grid or lattice (equivalent to fractions of theinter-pixel distance) between successive measurements.

The distance between two straight lines or edges, which might be thelength or breadth of a rectangular object in a digitized picture, canthen be obtained as the difference between their respective positionswithin an error which is a compound of the two separate small errors.When the positions of lines or edges are determined in one of theseways, secondary features such as angles or positions of corners can bedetermined to a high degree of accuracy. Furthermore, the calculationsof line position can be simplified by making use of the distinction inan image between the lattice, on the points of which the pixels arecentered, and a grid, which exists between the pixels. Thissimplification applies particularly to positioning curved lines oredges. In the case of a straight line or edge it is straightforward tocalculate the difference in position between a line calculated fromlattice points and that calculated from grid points, if the anglebetween the line and a coordinate axis is known. In either case, thesetting of this angle permits the measurement to be made in a mannersimilar to the employment of a vernier and, by reducing the angle, themeasurement can be of an indefinitely high accuracy, although in apractical situation the accuracy might be expected to be to only about20 times the pixel density, i.e. to about 1 part in 10,000 on a 512×512pixel array.

A method of making a measurement in accordance with the presentinvention will be described below, by way of example, with reference tothe accompanying drawings in which:

FIG. 1 is a representation of a picture obtained by digitizing an imageof an object viewed by a television camera, and

FIG. 2 is a representation in more detail of a part of the picture shownin FIG. 1.

Apparatus used in carrying-out the invention will be described below, byway of example, with reference to FIG. 3 of the accompanying drawings,which shows a block schematic circuit arranged with a diagrammatic sideview of an object.

Referring to FIG. 1, it will be understood that the requirement is tomonitor the length and breadth of a panel represented by an image havingsides 1, 2, 3 and 4 and the parallelism of its sides.

Referring to FIG. 2 which shows a part of the side 1, the filled circles5 mark the centers of pixels forming an interior "border" of thedigitized image of the panel, the open circles 6 mark an exterior"border" and the line 1 shows where the true edge of the image of thepanel falls. These two sets of circles may be considered to mark latticepoints. Either set may be used to calculuate the position of a line, buteither of the lines derived from such calculations may be distant fromthe line 1 marking the true edge of the panel by an amount up to √2/2times the unit length of the lattice-grid network. However, it isreadily seen that the small crosses 7 in FIG. 2, marking the cross-overpoints of a grid 8,9 straddle the line of the true edge and acalculation of the best line through the grid points is very close tothe line 1 of the true edge of the image. Whether the true line 1 isestimated from lattice points 5 and 6 or grid points 7, the errordepends on the number of points used and the angle between the true edge1 and the lattice-grid network 8,9. Suppose that a sufficient number oflattice 5,6 or grid 7 points is available to minimize any variation dueto the number of points, then, for a calculation based on latticepoints, the error in positioning the line 1 falls from 0.71 units whenthe line is inclined at 45° to 0.50 units when it is at 0° to a line oflattice points 5,6. However, for a calculation based on grid points thepositional error falls from 0.71 units at 45° inclination, linearly tozero as it approaches 0° inclination, to a grid line 8,9; although atexactly 0° the error is 0.50 units, as for the lattice pointcalculation. The method of measurement, in the particular embodiment, isto observe the panel at an inclination not more than a few degrees awayfrom parallelism with the lattice grid network. The positions of thesides can be measured to within a small fraction of a unit and thedimensions of the panel obtained to high accuracy. At the same time, theinclinations of the sides of respective lattice or grid lines can bemeasured and the parallelism or otherwise of the sides ascertained.

Should the object to be examined be bounded by sides that are notstraight, its edges can be monitored within tolerance limits by the samemethod, provided that the lines of the edges bounding the object can beexpressed by a mathematical equation. Circles, for example, with radiiof 100 units can be measured to 1 part in 10,000 in respect to radius,or to within 0.01 units in respect of the location of the center. Themethod can be applied to circular arcs (so obtaining curvature) but withan accuracy depending on the length of arc available.

Segments, or lengths of edge, of flat objects for which there may be aneed to check dimensions normally lie either between distinctive markswhich may be recognized by (or be made recognizable by) a TV camerasystem, or else between corners or indentations. The use of a gridboundary of an object (rather than either an interior or exteriorlattice boundary) makes the identification of corners or nodes veryeasy. There are many ways of arriving at an identification, but passinga sequence of grid boundary elements through an appropriate digitalfilter enables the result to be achieved simply and economically. Oncethe points have been identified, by whatever method, the position of theedge between two adjacent points, the distance along it, the shape ofthe edge, or the area of a segment, can be computed, as mentioned above,using the grid points either for a straight edge (as in FIG. 2) or for acurved one.

Referring now to FIG. 3, there is shown an object 12 arranged on asurface 13. Above the object, there is a camera 14 having an array oflight sensitive elements upon which an image of the object 12 appears.The lighting of the object and the color of the sampling surface aresuch that the image formed in the camera is sharp and well contrasted.The light sensitive elements in the camera are arranged in an array ofrequired pixel density that forms the basis of a digitizable coordinatesystem. The output of the camera is applied to the input of an imageanalyser and computer 15. A suitable image analyser and computer is soldby Buehler Ltd of Illinois, U.S.A. under the trade name Omnimet.

In a preferred embodiment, the picture signals are stored in theanalyzer and computer 15 while the analysis takes place.

The information resulting from the analysis, which relates therepresentation of the object 12 to the co-ordinate system, is obtainedfrom an output 16 and may be fed, for example, to a printer (not shown)where it is recorded. In a particular application where a tolerance isbeing checked, an output signal from 16 is arranged to operate an alarmdevice (not shown) which indicates that a tolerance has been exceeded.

It will be understood that the digitizable coordinate system may beseparate from the means, such as camera 14, for changing the visualimage into digital data. The coordinate system may be an arrayassociated with the object 12 and the representation of the object whichis converted into digital data may be a shadow of the object whoseposition bears a known relationship to the coordinate system array.

In arrangements measuring the length or position of a straight line, orthe straight edge of object, although it is possible to operate themethod with the line arranged at any angle less than 45° with respect toan axis of the coordinate system, improved results are obtained when theangle is less than 10° and preferably less than 5°.

It will be appreciated that by relating digital data derived from onepart of a representation of an object to digital data derived from acoodinate system of high resolution, such as 512×512 pixel raster, it ispossible to produce information about the object to a high degree ofaccuracy.

By relating digital data derived from a second part of therepresentation of the object to the data derived from the coordinatesystem, it is possible to produce second information about the object toa similar high degree of accuracy and to relate the two pieces ofinformation to one another in order to determine the distance betweenthe two parts.

It is also possible to repeat these operations a number of times eitherwith or without relative movement between the imaging device, the objector the measuring grid or lattice, and thereby to make a statisticalanalysis of the information and improve its accuracy.

Furthermore, by arranging that there is a comparatively small, i.e.,less than 45° and preferably less than 5° angular relationship between astraight edge and an axis of coordinate system (lattice or grid) it ispossible to achieve extremely accurate results, as the followinganalysis explains.

Considering a digitized picture of a flat object with a pair of parallelor near-parallel edges, the method outlined above can determine theposition of each edge accurately. There are many ways of writing theequation of the edge, but for simplicity of calculation we can take theform

    x sinθ.sub.1 -y cosθ.sub.1 =p.sub.1.

In this form, θ₁ is in the angle between the edge and the x-axis and p₁is the length of the perpendicular from the origin of coordinates ontothe line. The calculated position of the edge, obtained from thedigitized picture will be

    x sinθ'.sub.1 -y cosθ'.sub.1 =p'.sub.1

where p'₁ =p₁ +δ₁ and θ'₁ =θ₁ +ε₁ and δ₁ and ε₁ are observationalerrors. Similarly, the second edge will be calculated to be

    x sin θ'.sub.2 -y cosθ'.sub.2 =p'.sub.2.

In monitoring a rectangular panel, the first check is of the parallelismof the sides. A modest number of grid points (less than 100) will giveangular errors ε₁ and ε₂ less than 0.02°, which would be accurate enoughfor most purposes, allowing divergence or convergence of the edges at arate of less than 5 parts per 10,000 (i.e. 5 mm in 10 m). Assuming thatthe edges were within the tolerance of parallelism, their distance apartwould be given by p'₂ -p'₁ and the error in this estimate would be δ_(T)=√δ₁ ² +δ₂ ². For δ₁ =δ₂ =0.05 we have δ_(T) =0.07. The δ-values areabsolute, so it is advisable to make p'₂ -p'₁ as large as convenientlypossible. Thus with p'-p'₁ ≈200, the error is about 1 part in 3000 andit would be correspondingly less if p'₂ -p'₁ were greater.

In the case of measuring both length and breadth for a rectangular panelit might not be possible to have p'₂ -p'₁ for the width, say, largeenough if the corresponding length measurement, p"₂ -p"₁, say, were tobe measured from the same digitized picture. In such cases, it might benecessary to make separate measurements, at different magnifications, oflength and width.

It will be understood that, although the invention has been describedwith reference to particular arrangements, by way of example, variationsand modifications may be made within the scope of the accompanyingclaims; for example, where there is relative movement between an imagingdevice, the object of the coordinate system, the information may bederived during or after the movement. It will be appreciated that viewsfrom other directions than above may be taken and analyzed, for examplefrom the side.

We claim:
 1. A method of measuring the position of a line or an edgerelative to a coordinate reference system, said method including thesteps of arranging the line or edge, or an image thereof, and thecoordinate system in relative overlapping positions with, in the case ofa line, the line out of line with an axis of the coordinate system, andestablishing the distance between each of a plurality of points on theline or edge and an adjacent coordinate of the reference system, therebyto establish first information defining the position of the line or edgerelative to the coordinate system.
 2. A method as defined in claim 1including the steps of arranging a second line or edge, or an imagethereof, and the coordinate system in overlapping positions with, in thecase of a line, the second line out of line with an axis of thecoordinate system, and establishing the distance between each of aplurality of points on the second line or edge and an adjacentcoordinate of the reference system, thereby to establish secondinformation defining the position of the line or edge relative to thecoordinate system, and determining the relationship between thefirst-mentioned and the second line or edge from the first and secondinformations.
 3. A method as defined in claim 1 or 2 wherein a line orstraight edge is arranged at an angle of less than 10° with reference toan axis of the coordinate system.
 4. A method as defined in claim 1 or 2including repeating a plurality of times the step of establishing thedistance between each of a plurality of points on the line or edge andan adjacent coordinate, each repetitive step being made after relativemovement or apparent relative movement has taken place between theoverlapping line or edge and the coordinate system from their previousrelative position, and making a statistical analysis of the resultsobtained.
 5. Apparatus for use in carrying out a method as claimed inclaim 1 or 2 including a camera arranged to view a line or edge andrelate the line or edge to a digitizable coordinate system and means toanalyze the result of the relationship and to produce output informationrepresentative thereof.